﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
//
using Aop;
using DbFrame;
using DbFrame.BaseClass;
using Toolkit;
using Entitys;
using Entitys.SysClass;
using Logic.SysClass;
using System.Text;
using System.Threading.Tasks;

namespace HzyAdmin.Areas.Admin.Controllers
{
    public class HomeController : AdminBaseController
    {
        //
        // GET: /Admin/Home/
        public HomeController()
        {

        }

        Sys_MenuLogic _Logic = new Sys_MenuLogic();

        public async Task<ActionResult> Index()
        {
            StringBuilder _StringBuilder = new StringBuilder();
            _Logic.CreateMenus(Guid.Empty, await _Logic.GetMenuByRoleIDAsync(this._Account), _StringBuilder);
            ViewBag.Menus = _StringBuilder.ToString();
            ViewBag.UsreName = this._Account.UserName;
            return View(_Account);
        }

        /// <summary>
        /// 首页
        /// </summary>
        /// <returns></returns>
        public ActionResult Main()
        {
            return View();
        }

        /// <summary>
        /// 保持连接
        /// </summary>
        /// <returns></returns>
        [HttpPost]
        public ActionResult Connetct()
        {
            return this.Success();
        }

    }
}
